"use client"; import { useState, useEffect, use } from "react"; import { useRouter } from "next/navigation"; import Link from "next/link"; import Button from "@/components/shared/Button"; export default function ApplicationDetailsPage({ params }) { const router = useRouter(); const [application, setApplication] = useState(null); const [isLoading, setIsLoading] = useState(true); const [error, setError] = useState(null); const resolvedParams = use(params); useEffect(() => { fetchApplication(); }, []); async function fetchApplication() { try { const response = await fetch( `https://argus-core.brijesh.dev/twirp/applications.ApplicationsService/GetApplication`, { method: "POST", headers: { "Content-Type": "application/json", }, body: JSON.stringify({ token: localStorage.getItem("token"), application_id: resolvedParams.id, }), }, ); const data = await response.json(); if (data.code || data.msg) { throw new Error(data.msg || "Failed to fetch application"); } setApplication(data.application); } catch (error) { setError(error.message || "Failed to load application"); console.error("Error:", error); } finally { setIsLoading(false); } } if (isLoading) return
{application.description}
Use this application's API key to send logs to Argus. Refer to our documentation for detailed integration instructions.